1.Field of the Invention
The present invention relates to a color image processing method and an apparatus for carrying out such a method that is capable of extracting a desired object from an input color image on the basis of a detected contour of the object, so as to perform color adjustment or image composition. Particularly, the present invention relates to such a color image processing method and an apparatus for the same that is capable of automatically extracting a desired object while requiring a simple operation from the operator.
Image processing technology is used in a wide variety of fields including design systems employing computers, computer graphics, desk-top publishing capable of producing illustrated documents, and systems for producing printing originals. In image processing technology, an object in an image may be subjected to various processings such as a processing for changing the color of the object (color-changing), a processing for changing the size or the shape of the object (enlargement, reduction, or transfiguration), a processing for composing the object with another image (composition), and a processing for recognizing that portion of the image representing the particular object which may be, for example, a human figure, a vehicle or a desk (recognition). For instance, in a system for designing goods such as packages or vehicles, or a system for designing posters or the like, computer-graphic images are produced by employing a computer, or an original image, in particular, a color original image, is input through a reader, and then subject to processings such as those for changing the size, shape and/or color of the image or those for changing a background portion of the image.
In processing a color image with a computer, it is required that processings, such as color-changing, enlargement, reduction, transfiguration, composition and recognition, can be easily performed with high precision; it is also required to have an interface between the operator and the computer (i.e., a human interface) which can be easily used. In the case where an object in an image is subjected to a processing such as color-changing, enlargement, reduction, transfiguration, composition or recognition, the object to be processed must first be extracted from the original image by detecting the contour of the object and extracting both the contour of the object and the object proper enclosed by the contour. Since such object-contour detection and object extraction are essential to the subsequent image processing, they are required to be able to be easily performed with high precision.
The level of ease with which object-contour detection and object extraction can be performed is important in order to increase the work efficiency of the entire image processing. The level of precision of object-contour detection and object extraction is also important because this determines the quality of an image that can be finally obtained (i.e., the degree in which the results of color-changing or composition are natural). Therefore, it is desired that object-contour detection and object extraction be effected by a method which enables higher levels of ease and precision.
2. Description of the Related Art
Regarding object-contour detection, a conventional method for contour detection generally employs a differentiation process or a threshold provided for differences in density or brightness at a boundary. That is, a contour of an object is detected by subjecting the entire image to a batch differentiation process, or by providing an appropriate threshold set by the operator in such a manner that only the contour of the object can be aptly detected.
Regarding object extraction, almost all the operations for object extraction have been manually performed by the operator. That is, when an image is displayed on a display, the operator checks each boundary portion of the image, and uses a mouse or a light-pen to give specification as to whether each pixel in a boundary portion is to be extracted or not. A conventional object extraction method is, to some extent, adapted for automatic extraction of an object. In this method, certain properties of the object to be extracted, such as the color of the object, the pattern on the surface of the object, or changes thereof, are utilized so that only those portions having similar properties, such as similar colors or similar spatial frequencies, are extracted as the object.
However, a conventional contour detection method employing a differentiation process has the following disadvantage: since the entire image is subjected to a batch process, the results of detection may include the contour of an object other than the pertinent object to be extracted, or an unwanted boundary, such as an edge, within the object. A conventional contour detection method employing a threshold is disadvantageous in that, in general, the entire contour of an object cannot be properly detected with a single threshold, and it is necessary to provide a threshold appropriate for each boundary position at which detection is wanted, thereby resulting in poor work efficiency. In addition, both a method employing a differentiation process and a method employing a threshold require a substantial amount of aid from the operator in order that a contour line of the target object can be finally obtained as a continuous closed line. As a result, work efficiently is poor, and the precision of detection cannot be greatly improved.
Conventional object extraction which relies on manual operations by the operator has a disadvantage in that the work requires much time and labor. For example, it takes several hours for an operator to successfully extract an object, such as a vehicle, in an image displayed on a screen even when the operator is experienced at least to some extent. The need for such a long period of time results particularly from pixels in the boundary portion of the object. With regard to these pixels, it is necessary to judge whether each of the pixels is to be included in the object or the background. For this purpose, the image must be enlarged, and judgement must be made for each point (each pixel).
A conventional object extraction method utilizing a particular property of the object, such as the color or spatial frequency thereof, is not capable of accurately extracting the object alone, and accordingly, has a low level of extraction precision. For example, when extracting an object by utilizing the color of the object, which is a property thereof, there is the requisite that the color of the object be absent from the background. If the background contains any image portion of the same color as the object, the image portion in the background is extracted together with the object, providing poor precision of extraction. In addition, even when an object is entirely of a particular color, the object may have portions varying in tone, such as a relatively dark portion representing a shadow, or a relatively light portion representing luster, and it is difficult to extract the object including these portions as a whole.
When object extraction has such poor precision as to result in an image portion that should belong to the background being extracted, or an image portion that should belong to the object remaining unextracted, the subsequent image processing, such as color-changing, composition, enlargement, reduction, or transfiguration, provides an image of poor quality, such as an image including an unnecessarily color-changed portion in the background.